import Vue from "vue";

const getCurPage = () => {
  // #ifdef MP-WEIXIN
  let pages = getCurrentPages();
  let cur = pages[pages.length - 1];
  return cur;
  // #endif

};
const getPrevPage = () => {
  // #ifdef MP-WEIXIN
  let pages = getCurrentPages();
  return pages[pages.length - 2];
  // #endif

};
const getPageTitle = () => {
  // #ifdef MP-WEIXIN
  let pages = getCurrentPages();
  let cur = pages[pages.length - 1];
  return cur.data.$pageName;
  // #endif

};

Vue.prototype.$pages = {
  getCurPage,
  getPrevPage,
  getPageTitle
};